<!--
 *
 * FaZend Framework
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt. It is also available 
 * through the world-wide-web at this URL: http://www.fazend.com/license
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@fazend.com so we can send you a copy immediately.
 *
-->
 
<?php
    $this->headTitle('analysis model');
    $this->includeCSS('ui.css');
    $this->includeCSS('analysis.css');
?>

<div class="wrapper">

    <div class="header">
        <div class="path">
            <?php $sectors = explode(FaZend_Pan_Analysis_Diagram::SEPARATOR, $this->diagram->getName()); ?>
            <?php foreach (array_slice($sectors, 0, -1) as $i=>$sector): ?><a
                href="<?php 
                echo $this->url(
                    array(
                        'diagram'=>
                        implode(FaZend_Pan_Analysis_Diagram::SEPARATOR, array_slice($sectors, 0, $i+1)) . 
                        FaZend_Pan_Analysis_Diagram::SEPARATOR . 
                        $sectors[count($sectors)-1]
                    ), 
                    'analysis'
                )?>"><?php echo $sector?></a
                ><?php echo FaZend_Pan_Analysis_Diagram::SEPARATOR?><?php endforeach; 
                ?><?php echo $sectors[count($sectors)-1]?>
        </div>
    </div>

    <div class="page">
        <div class="types">
            <?php foreach (FaZend_Pan_Analysis_Diagram::getTypes() as $type): ?>
                <div class="type">
                    <img src="<?php echo $this->viewFile('analysis/types/' . $type . '.png')?>" />
                    <br/>
                    <?php if ($this->diagram->getType() == $type): ?>
                        <b><?php echo $type?></b>
                    <?php else: ?>
                        <a href="<?php 
                        echo $this->url(
                            array('diagram'=>$this->diagram->getAnotherType($type)), 
                            'analysis'
                        )?>"
                            ><?php echo $type?></a>
                    <?php endif; ?>
                </div>
            <?php endforeach; ?>
        </div>
        
        <div class="components"><ul>
            <?php foreach ($this->diagram->getComponentsToShow() as $component): ?>    
                <li><a href="<?php echo 
                $this->url(
                    array('diagram'=>$component->getDiagramName($this->diagram->getType())), 
                    'analysis'
                )?>"><?php echo $component->getName()?></a></li>
            <?php endforeach; ?>
        </ul></div>

        <object 
            style="overflow: auto;"
            data="<?php echo $this->url(array('action'=>'svg', 'diagram'=>$this->diagram->getName()), 'analysis')?>"
            width="<?php echo FaZend_Pan_Analysis_Diagram::WIDTH?>" 
            height="<?php echo FaZend_Pan_Analysis_Diagram::HEIGHT?>" 
            type="image/svg+xml" 
            />
            
    </div>

</div>

